﻿using System;
using System.IO;
using System.Reflection;

public class AppInfo {
	public static string Title {
		get {
			object[ ] attributes = Assembly.GetExecutingAssembly( ).GetCustomAttributes(typeof(AssemblyTitleAttribute), false);
			if (attributes.Length == 0) {
				return System.IO.Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly( ).CodeBase);
			}
			return ((AssemblyTitleAttribute)attributes[0]).Title;

		}
	}
	public static string Description {
		get {
			object[ ] attributes = Assembly.GetExecutingAssembly( ).GetCustomAttributes(typeof(AssemblyDescriptionAttribute), false);
			if (attributes.Length == 0) {
				return "";
			}
			return ((AssemblyDescriptionAttribute)attributes[0]).Description;
		}
	}
	public static string Company {
		get {
			object[ ] attributes = Assembly.GetExecutingAssembly( ).GetCustomAttributes(typeof(AssemblyCompanyAttribute), false);
			if (attributes.Length == 0) {
				return "";
			}
			return ((AssemblyCompanyAttribute)attributes[0]).Company;
		}
	}
	public static string Product {
		get {
			object[ ] attributes = Assembly.GetExecutingAssembly( ).GetCustomAttributes(typeof(AssemblyProductAttribute), false);
			if (attributes.Length == 0) {
				return "";
			}
			return ((AssemblyProductAttribute)attributes[0]).Product;
		}
	}
	public static string Copyright {
		get {
			object[ ] attributes = Assembly.GetExecutingAssembly( ).GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false);
			if (attributes.Length == 0) {
				return "";
			}
			return ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
		}
	}
	public static Version Version {
		get {
			AssemblyName assemblyName = new AssemblyName(Assembly.GetExecutingAssembly( ).FullName);

			return assemblyName.Version;
		}
	}
	public static DateTime ReleasionDate {
		get {
			return new DateTime(2000, 1, 1).AddDays(AppInfo.Version.Build).AddSeconds(AppInfo.Version.Revision * 2).AddHours(-1);
		}
	}
	public static FileInfo ExecutablePath {
		get {
			return new FileInfo(Assembly.GetExecutingAssembly( ).Location);
		}
	}
}